import Vue from 'vue'
import Vuex from 'vuex'

//挂载Vuex
Vue.use(Vuex)

//创建VueX对象
const store = new Vuex.Store({
  state: {
    //存放的键值对就是所要管理的状态
    pathName: '',
    pathNum: 0,
    dress_new:[],//装扮商城跳转页面状态管理
    exchange_num:0,//装扮商城跳转页面状态管理
  },
  mutations: {
    //es6语法，等同edit:funcion(){...}
    change(state, routernName) { //改变路由值
      state.pathName = routernName
    },
     //es6语法，等同edit:funcion(){...}
     dress_new(state, dress_new,exchange_num) { //改变路由值
      state.dress_new = dress_new
      state.exchange_num = exchange_num
    },
    empty(state) { //清空路由值
      state.pathName = ""
      state.pathNum = 0
    },
    change2(state,pathNum){
        state.pathNum = pathNum
    }
  }
})

export default store
